﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AcmeSportsStore
{
    class PurchasedItem : IComparable
    {
        protected int uId; //Unique Id: because there is no unique id in purchased items
        protected string itemId;
        protected string custId;
        protected string purchasedDate;
        protected string deliverDate;
        protected string price;

        public PurchasedItem(int uId, string itemId, string custId, string purchasedDate, string deliverDate, string price)
        {
            this.uId = uId;
            this.itemId = itemId;
            this.custId = custId;
            this.purchasedDate = purchasedDate;
            this.deliverDate = deliverDate;
            this.price = price;
        }

        public int UId
        {
            get { return uId; }
            set { uId = value; }
        }

        public string CustId
        {
            get { return custId; }
            set { custId = value; }
        }

        public string ItemId
        {
            get { return itemId; }
            set { itemId = value; }
        }

        public string PurchasedDate
        {
            get { return purchasedDate; }
            set { purchasedDate = value; }
        }

        public string DeliverDate
        {
            get { return deliverDate; }
            set { deliverDate = value; }
        }

        public string Price
        {
            get { return price; }
            set { price = value; }
        }

        public override string ToString()
        {
            return itemId + ";" + custId + ";" + purchasedDate + ";" + deliverDate + ";" + price;
        }

        public int CompareTo(object obj)
        {
            PurchasedItem that = (PurchasedItem)obj;
            return this.uId.CompareTo(that.uId);
        }
    }
}

